<?php

// Inialize session
session_start();

// Check, if username session is NOT set then this page will jump to login page
if (!isset($_SESSION['username'])) {
        header('Location: index.php');
}

?>
<?php
ob_start();
require_once('FirePHPCore/FirePHP.class.php');

include 'functions.php';
include 'additionalFunctions.php';
$allAttributes = getAllAttributes();

function displayTable($_GET){
	$allAttributes = getAllAttributes();
	$result = "<table id=\"example1\" align=\"center\" class=\"tablecss\"><thead><tr><th></th><th></th>";
	if (count($_GET) > 0) {
		if(!isset($_GET['date1']) || !$_GET['date1']){
			return 'Unable to make table: no start date specified';
		}
		if(!isset($_GET['date2']) || !$_GET['date2']){
			return 'Unable to make table: no end date specified';
		}
		$startDate = $_GET['date1'];
		$endDate = $_GET['date2'];
		if(isset($_GET['crops'])) $crops = explode(";",$_GET["crops"]);
		else $crops = array();
		$cropsFormatted = array();
		$units = array();
		foreach ($crops as $c) {
			$cropsFormatted[] = substr($c, 0, strripos($c, " - ")); // finds the last position of occurence of " - " ==> takes only the crop name, not the units
			$units[] = substr($c, strripos($c, " - ") + 3); // gets just the name of the unit
		}
		
		$cropNames = $cropsFormatted;
		$crops = getCropIds($cropsFormatted);

		$nameAssoc = array();
		foreach($cropNames as $cropName){
			$nameAssoc[$cropName] = getCropId($cropName);
		}


		$attrs = array();

		foreach($_GET as $name => $value) {
			if(array_key_exists($name, $allAttributes)){
				$attrs[] = $name;
			}
		}
		if(count($attrs) == 0){
			return "Unable to make table: no attributes to display specified";
		}
		$startYear = substr($startDate,6,4);
		$endYear = substr($endDate,6,4);
		
		$startDate = $startYear . "-" . substr($startDate,0,2) . "-" . substr($startDate,3,2);
		$endDate = $endYear . "-" . substr($endDate,0,2) . "-" . substr($endDate,3,2);
		
		$rows = array();
		if(strcmp($startYear, $endYear) == 0 && count($crops) <= 1){
			// 1 crop, summed monthly, multiple attributes allowed
			// (or, all crops added together monthly, multiple attributes allows)
			include 'cropExplorerFiles/case1.php';
		}elseif(strcmp($startYear, $endYear) == 0 && count($attrs) == 1 && count($crops) >= 2){
			// multiple crops allowed. 1 attribute summed monthly.
			include 'cropExplorerFiles/case2.php';

		}//elseif(count($attrs) == 1){ //Getting rid of this one to make it conform to years being on the side rather than top --> will execute case5.php instead (or possibly case4?)
			// multiple crops summed yearly over multiple years. 1 attribute only
			//include 'cropExplorerFiles/case3.php';

		//}
		elseif(count($crops) == 1){
			// 1 crop, summed yearly over multiple years. multiple attributes allowed
			include 'cropExplorerFiles/case4.php';
		}else{
			// multiple crops added together yearly over multiple years. One or Multiple attributes allowed
			include 'cropExplorerFiles/case5.php';
		}
		
		$result = $result . "</tbody></table>";
		return $result;
	}
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Conjunction 
Description: A two-column, fixed-width design for 1024x768 screen resolutions.
Version    : 1.0
Released   : 20100328

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Dilmun Tools</title>
<script src="calenderPopup.js" language="JavaScript"></script>

<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" language="javascript" src="jquery.js"></script> 
<script type='text/javascript' language="javascript" src="DataTables-1.7.3/media/js/jquery.dataTables.min.js"></script>
<style type="text/css">
      @import "DataTables-1.7.3/media/css/demo_table.css";
</style> 
  
<script type="text/javascript">
// javascript / ajax for live search in search bar
			function showCrops(str)
			{
			if (str=="")
			  {
			  document.getElementById("txtHint").innerHTML="";
			  return;
			  }
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			    {
			    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
			    }
			  }
			xmlhttp.open("GET","getCrop.php?q="+str,true);
			xmlhttp.send();
			//code adapted from http://www.w3schools.com/php/php_ajax_database.asp
			}
			
			//show Monthly Subtable
			function showMonthlyTable(year) {
	
				//return "<tbody><tr><td>1</td><td>2</td></tr></tbody>";
				if (window.XMLHttpRequest)
				  {// code for IE7+, Firefox, Chrome, Opera, Safari
				  xmlhttp=new XMLHttpRequest();
				  }
				else
				  {// code for IE6, IE5
				  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
				  }
				xmlhttp.onreadystatechange=function()
				  {
				  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				    {
				    var ajaxTablePlusCounter = "ajaxTable"+(counter-1).toString();
				    document.getElementById(ajaxTablePlusCounter).innerHTML=xmlhttp.responseText;
				    }
				  }
				  <?php include 'cropExplorerFiles/getAllAttributes.php';
				  $attrsString = "";
				  foreach ($arrayOfSelectedAttributes as $a) {
				  	if ($attrsString == "") {
				  		$attrsString = "$a";
				  	}
				  	else {
				  		$attrsString = $attrsString . ";$a";
				  	}
				  }
				  ?>
				  var attrsString1 = "<?php print $attrsString; ?>";
				xmlhttp.open("GET","cropExplorerFiles/ajaxFiles/response1.php?year="+year+"&crops=<?php print $_GET['crops'] ?>"+"&attributes="+attrsString1+"&customers="+$_GET('customers')+"&donationCustomers="+$_GET('donationCustomers'),true);
				xmlhttp.send();
				
			}
			
			//show Weekly Subtable
			function showWeeklyTable(month, year) {
	
				if (window.XMLHttpRequest)
				  {// code for IE7+, Firefox, Chrome, Opera, Safari
				  xmlhttp=new XMLHttpRequest();
				  }
				else
				  {// code for IE6, IE5
				  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
				  }
				xmlhttp.onreadystatechange=function()
				  {
				  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				    {
				    var ajaxTablePlusCounter = "ajaxTable"+(counter-1).toString();
				    document.getElementById(ajaxTablePlusCounter).innerHTML=xmlhttp.responseText;
				    }
				  }
				  <?php include 'cropExplorerFiles/getAllAttributes.php';
				  $attrsString = "";
				  foreach ($arrayOfSelectedAttributes as $a) {
				  	if ($attrsString == "") {
				  		$attrsString = "$a";
				  	}
				  	else {
				  		$attrsString = $attrsString . ";$a";
				  	}
				  }
				  ?>
				  var attrsString1 = "<?php print $attrsString; ?>";
				xmlhttp.open("GET","cropExplorerFiles/ajaxFiles/response3.php?month="+month+"&year="+year+"&crops=<?php print $_GET['crops'] ?>"+"&attributes="+attrsString1+"&customers="+$_GET('customers')+"&donationCustomers="+$_GET('donationCustomers'),true);
				xmlhttp.send();
				
			}
			
			function showMonthlyTableMultipleCrops(yearOrMonth, allTheSelectedCropsArray) {
				if (window.XMLHttpRequest)
				  {// code for IE7+, Firefox, Chrome, Opera, Safari
				  xmlhttp=new XMLHttpRequest();
				  }
				else
				  {// code for IE6, IE5
				  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
				  }
				xmlhttp.onreadystatechange=function()
				  {
				  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				    {
				    var ajaxTablePlusCounter = "ajaxTable"+(counter-1).toString();
				    document.getElementById(ajaxTablePlusCounter).innerHTML=xmlhttp.responseText;
				    }
				  else if (xmlhttp.readyState >= 1 && xmlhttp.readyState <= 3) //not working?
				    {
				    var ajaxTablePlusCounter = "ajaxTable"+(counter-1).toString();
				    document.getElementById(ajaxTablePlusCounter).innerHTML="<tr><td>...loading...</td></tr>";
				    }
				  }
				  <?php include 'cropExplorerFiles/getAllAttributes.php';
				  $attrsString = "";
				  foreach ($arrayOfSelectedAttributes as $a) {
				  	if ($attrsString == "") {
				  		$attrsString = "$a";
				  	}
				  	else {
				  		$attrsString = $attrsString . ";$a";
				  	}
				  }
				  ?>
				  var attrsString1 = "<?php print $attrsString; ?>";
				  var selectedA = document.getElementById("selectForm").value;
				xmlhttp.open("GET","cropExplorerFiles/ajaxFiles/response4.php?year="+yearOrMonth+"&crops=<?php print $_GET['crops'] ?>"+"&attributes="+attrsString1+"&selectedA="+selectedA+"&customers="+$_GET('customers')+"&donationCustomers="+$_GET('donationCustomers'),true);
				xmlhttp.send();
			}
			
			function showWeeklyTableMultipleCrops(yearOrMonth, year, allTheSelectedCropsArray) {
				if (window.XMLHttpRequest)
				  {// code for IE7+, Firefox, Chrome, Opera, Safari
				  xmlhttp=new XMLHttpRequest();
				  }
				else
				  {// code for IE6, IE5
				  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
				  }
				xmlhttp.onreadystatechange=function()
				  {
				  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				    {
				    var ajaxTablePlusCounter = "ajaxTable"+(counter-1).toString();
				    document.getElementById(ajaxTablePlusCounter).innerHTML=xmlhttp.responseText;
				    }
				  }
				  <?php include 'cropExplorerFiles/getAllAttributes.php';
				  $attrsString = "";
				  foreach ($arrayOfSelectedAttributes as $a) {
				  	if ($attrsString == "") {
				  		$attrsString = "$a";
				  	}
				  	else {
				  		$attrsString = $attrsString . ";$a";
				  	}
				  }
				  ?>
				  var attrsString1 = "<?php print $attrsString; ?>";
				  var selectedA = document.getElementById("selectForm").value;
				xmlhttp.open("GET","cropExplorerFiles/ajaxFiles/response5.php?month="+yearOrMonth+"&year="+year+"&crops=<?php print $_GET['crops'] ?>"+"&attributes="+attrsString1+"&selectedA="+selectedA+"&customers="+$_GET('customers')+"&donationCustomers="+$_GET('donationCustomers'),true);
				xmlhttp.send();
			}
			
			// javascript for when a user clicks on a crop after searching and wishes to add it to the basket
			function addToBasket(str) { 
				//remove the text that is already there if adding first item to basket.
				//not working correctly - may get back to this later
				/*var txt=document.getElementById("basket").firstChild.innerHTML;
				console.log(txt);
				if (txt == "Basket is empty") {
					document.getElementById("basket").innerHTML="<p>" + str + "</p>";
				}*/
				
				node=document.createElement('p');
				node.setAttribute("id","basketEntry");
				text=document.createTextNode(str);
				node.appendChild(text);
				document.getElementById("basket").appendChild(node);
				
				node2 = document.getElementById("hiddenForm");
				if (node2.value == "") {
					node2.value = node2.value + str;
				}
				else {
					node2.value = node2.value + ";" + str;
				}
			}
			
			function submitForm() {
			// i've had it up to here with this function.
			// i'm never calling it.

				var itemsInBasket = document.getElementById("basket").getElementsByTagName("p");
				if (itemsInBasket.length === 1){
					//do nothing
				}
				else {
					var crops = new Array();
					var int = 0;
					for (var item1 in itemsInBasket) {
						if (i === 0) {
						// do nothing; skip the header
						}
						else {
							crops[i] = item1.innerHTML;
						}
						i++;
					}
					var variables = new Array();
					i = 0;
					for (var item2 in crops) {
						variables[i] = "crop" + i + "=" + item2;
						i++;
					}
					

		// this seems like a very silly way of generating the parameters for the submit
		// wouldn't it be easier just to make all of the <input>s in this page part of the same
		// <form> and then just submit the form? I'm not doing this now, because I'm afraid it might
		// break the calenders and I don't want to debug them. ======>>>>> I was trying to implement
		// functionality in which submit() would load the data without having to refresh the page, 
		// but it didn't work.  I don't think this function ever gets called, but I'm not 100% sure.



					var amount_harvested = document.getElementById("amount_harvested").checked;
					var number_planted = document.getElementById("number_planted").checked;
					var sales = document.getElementById("sales").checked;
					var amount_donated = document.getElementById("amount_donated").checked;
					var weed_issues = document.getElementById("weed_issues").checked;
					var pest_issues = document.getElementById("pest_issues").checked;
					
					if (category === true) {
						variables[i] = "category=true";
						i++;
					}
					if (quantity === true) {
						variables[i] = "quantity=true";
						i++;
					}
					if (cost === true) {
						variables[i] = "cost=true";
						i++;
					}
					if (season === true) {
						variables[i] = "season=true";
						i++;
					}
					if (plantTime === true) {
						variables[i] = "plantTime=true";
						i++;
					}
					if (harvestTime === true) {
						variables[i] = "harvestTime=true";
						i++;
					}
					if (pestIssues === true) {
						variables[i] = "pestIssues=true";
						i++;
					}
					
					var getVarString = "";
					for (i=0;i<variables.length-1;i++) {
						getVarString = getVarString + variables[i] + "&";
					}
					getVarString = getVarString + variables[variables.length-1];
					
					window.location = "http://localhost/~Greg/DH/" + "cropDatabaseInfo.php?" + getVarString;
					
				}
				
			}
			function returnSelectedCrops() {
				return "test";
			}
			function calender() {
				var cal = new CalendarPopup("testdiv1");
				cal.select(document.getElementById('dateBox'), 'anchor1', 'MM/dd/yyyy');
				return cal;
			}
			
			//the following code block was adapted from http://www.onlineaspect.com/2009/06/10/reading-get-variables-with-javascript/
			//it allows the use of the GET variable in javascript; later on, it is used to check if the same year was selected for startdate and enddate
			function $_GET(q,s) {
		        s = (s) ? s : window.location.search;
		        var re = new RegExp('&'+q+'=([^&]*)','i');
		        return (s=s.replace(/^\?/,'&').match(re)) ? s=s[1] : s='';
		    }
		    
		    function showCustomerDropdown() {
		    	if (document.getElementById('customerDropdownDiv').innerHTML == "") {
			    	var str = "Select Customer: <br />";
					str += "<select name='customers'>";
						<?php
						$customers = getSalesCustomers();
						$str = "";
						$str = $str."\"<option value='all'>All Sales Customers</option>\"+";
						foreach ($customers as $c) {
							$str = $str."\"<option value=\\\"".$c['customername']."\\\">".$c['customername']."</option>\"+";
						}
						$str = $str."\"\"";
						?>
						str = str + <?php print $str; ?>;
					str = str + "</select><br />";
					document.getElementById("customerDropdownDiv").innerHTML=str;
				}
				else {
					var spanElement = document.getElementById('customerDropdownDiv');
					spanElement.innerHTML="";
				}
		    }
		    function showDonationCustomerDropdown() {
		    	if (document.getElementById('donationCustomerDropdownDiv').innerHTML == "") {
			    	var str = "Select Customer: <br />";
					str += "<select name='donationCustomers'>";
						<?php
						$customers = getDonationCustomers();
						$str = "";
						$str = $str."\"<option value='all'>All Donation Customers</option>\"+";
						foreach ($customers as $c) {
							$str = $str."\"<option value=\\\"".$c['customername']."\\\">".$c['customername']."</option>\"+";
						}
						$str = $str."\"\"";
						?>
						str = str + <?php print $str; ?>;
					str = str + "</select><br />";
					document.getElementById("donationCustomerDropdownDiv").innerHTML=str;
				}
				else {
					var spanElement = document.getElementById('donationCustomerDropdownDiv');
					spanElement.innerHTML="";
				}
		    }
			
			
			//<!--<a id="anchor1" name="anchor1" title="cal1.select(document.forms[0].date1,'anchor1','MM/dd/yyyy'); return false;" onclick="cal1.select(document.forms[0].date1,'anchor1','MM/dd/yyyy'); return false;" href="#">select</a>-->
		</script>
		
		<script language="JavaScript">
			var cal = new CalendarPopup();
			cal.setCssPrefix("TEST");
			
			var cal2 = new CalendarPopup();
			cal2.setCssPrefix("TEST");
		</script>
		
		<script type="text/javascript">
		var oTable;
		var pTable;
		var counter = 1;
		
		/* Formating function for row details */
		function fnFormatDetails ( nTr, yearOrMonth, year )
		{
			/*var aData = oTable.fnGetData( nTr );
			var sOut = '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">';
			sOut += '<tr><td>Rendering engine:</td><td>'+aData[2]+' '+aData[5]+'</td></tr>';
			sOut += '<tr><td>Link to source:</td><td>Could provide a link here</td></tr>';
			sOut += '<tr><td>Extra info:</td><td>And any further details here (images etc)</td></tr>';
			sOut += '</table>';*/
			
			
			var sOut = '<div id="subTable1"><table id="ajaxTable'+counter+'" class="tablecss" cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;width:100%">';
			counter += 1;
			//"<table id=\"example1\" align=\"center\" class=\"tablecss\"><thead><tr><th></th><th></th>";
			//sOut += "<tr><td><img src=\"DataTables-1.7.3/details_open.png\" /></td><td>January</td><td></td><td></td></tr>";
			
			var allTheSelectedCropsArray = $_GET('crops').split("%3B");
			
			if (allTheSelectedCropsArray.length == 1) { // if only one crop was selected
				if (yearOrMonth == "January" || yearOrMonth == "February" || yearOrMonth == "March" || yearOrMonth == "April" || yearOrMonth == "May" || yearOrMonth == "June" || yearOrMonth == "July" || yearOrMonth == "August" || yearOrMonth == "September" || yearOrMonth == "October" || yearOrMonth == "November" || yearOrMonth == "December") {
					showWeeklyTable(yearOrMonth, year);
				}
				else {
					showMonthlyTable(yearOrMonth);
				}
			}
			else { // if more than one crop was selected
				if (yearOrMonth == "January" || yearOrMonth == "February" || yearOrMonth == "March" || yearOrMonth == "April" || yearOrMonth == "May" || yearOrMonth == "June" || yearOrMonth == "July" || yearOrMonth == "August" || yearOrMonth == "September" || yearOrMonth == "October" || yearOrMonth == "November" || yearOrMonth == "December") {
					showWeeklyTableMultipleCrops(yearOrMonth, year, allTheSelectedCropsArray);
				}
				else {
					showMonthlyTableMultipleCrops(yearOrMonth, allTheSelectedCropsArray);
				}
			}
			
			sOut += '</table></div>';
			
			return sOut;
		}
		$(document).ready(function() {
			oTable = $('#example1').dataTable( {
			} );
			

			$('#example1 tbody td img').live( 'click', function () {
				var nTr = this.parentNode.parentNode;
				if ( this.src.match('details_close') )
				{
					/* This row is already open - close it */
					this.src = "DataTables-1.7.3/details_open.png";
					oTable.fnClose( nTr );
				}
				else
				{
					/* Open this row */
					this.src = "DataTables-1.7.3/details_close.png";
					if (this.id == "January" || this.id == "February" || this.id == "March" || this.id == "April" || this.id == "May" || this.id == "June" || this.id == "July" || this.id == "August" || this.id == "September" || this.id == "October" || this.id == "November" || this.id == "December") {
						var year1 = $_GET('date1').substring($_GET('date1').lastIndexOf("%2F") + 3); // get just the year
						var year2 = $_GET('date2').substring($_GET('date2').lastIndexOf("%2F") + 3);
						
						if (year1 == year2) {
							oTable.fnOpen( nTr, fnFormatDetails(nTr, this.id, year1), 'details' );
						}
						else {
							var year = this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.childNodes[1].innerHTML
							oTable.fnOpen( nTr, fnFormatDetails(nTr, this.id, year), 'details' );
						}
					}
					else {
						oTable.fnOpen( nTr, fnFormatDetails(nTr, this.id, null), 'details' );
					}
				}
			} );
		} );
		pTable = $('#ajaxTable1').dataTable( {
			} );
		</script>
</head>
<body>
	
		<?php
			include 'headinfo.php';
		?>
	<hr />
	<!-- end #logo -->
	<div id="header">
		<?php
			$thispage = "Crop Explorer";
			require 'menu.php';
		?>
		<!-- end #menu -->
	</div>
	<!-- end #header -->
	<!-- end #header-wrapper -->
	<div id="page">
		<div id="content">
		  <div class="post">
		  		<!- Start of content-->
				<h2 class="title"><a href="#">Crop Explorer </a></h2>
				<p class="meta"></p>
				<div class="entry">
					
					<div id="viewCropData">
						<div class="colmask threecol">
						<form name="input">
				  		<div class="colmid">
				  		<div class="colleft">
				  		
				  		<div class="col1">
						
						
						<div id="calendar1">				
							<table><tr><td>
							Choose Start Date:</td><td><input id="dateBox" type="text" name="date1" value="03/01/2009" /></td>
							<td><A HREF="#" id="anchor1" name="anchor1" title="cal.select(document.input.date1,'anchor1','MM/dd/yyyy'); return false;" onClick="cal.select(document.input.date1, 'anchor1', 'MM/dd/yyyy'); return false;">Select</A></td></tr>
						
							<div id="testdiv1"></div>
						</div>
						
						<div id="calendarEnd">			
							<tr><td>Choose End Date:</td><td><input id="dateBox2" type="text" name="date2" value="11/30/2009" /></td>
							<td><A HREF="#" id="anchor2" name="anchor2" title="cal2.select(document.input.date2,'anchor2','MM/dd/yyyy'); return false;" onClick="cal2.select(document.input.date2, 'anchor2', 'MM/dd/yyyy'); return false;">Select</A></td></tr></table>
						<div id="testdiv2">
						</div>
						</div>
						</div>
						<!--col1-->
					
					<div class="col2">
					Type Crop Name: <br /><input type="text" name="cropName" onkeyup="showCrops(this.value)" onblur="this.value=''" /><br />
					
					<!/div>
					<div id="txtHint">
						<i>Begin typing a crop name.</i>
					</div>
					<div id="basket">
						<p>Basket:</p>
					</div>
					</div><!-col2>
					
					<div class="col3">
					<div id="cropAttributes">
						<p>
						
						<?php foreach($allAttributes as $i => $j): 
								if ($j == "Sales") { 
									print "<input type=\"checkbox\" name=\"".$i."\" id=\"".$i."\" onmouseup=\"showCustomerDropdown()\" />".$j."<br />";
									print "<span id='customerDropdownDiv'></span>";
								}
								else if ($j == "Amount Donated") { 
									print "<input type=\"checkbox\" name=\"".$i."\" id=\"".$i."\" onmouseup=\"showDonationCustomerDropdown()\" />".$j."<br />";
									print "<span id='donationCustomerDropdownDiv'></span>";
								}
								else if (($j != "Pest Issues") && ($j != "Weed Issues")) {
									print "<input type=\"checkbox\" name=\"".$i."\" id=\"".$i."\" />".$j."<br />";
								}
							?>
						<?php endforeach; ?>
						</p>
			
						<br />		
						<input type="hidden" id="hiddenForm" name="crops" value="">
						<input type="submit" value="View">	
						</form>
						&nbsp;&nbsp;<a href="cropDatabaseInfo.php">Clear</a>		
					</div>
				</div><!--col3-->
				</div></div></div><!--colmask, colmid, colleft-->
				<div id="tableDisplay">
	
					<?php echo displayTable($_GET) ?>
	
				</div>
				
			</div>
	  </div>
	</div>
	</div><!-- end #content -->
	
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #page -->
<div id="footer">
	<p>Copyright (c) 2010 Dilmun Hill Team.</p>
</div>
<!-- end #footer -->
</body>
</html>
